<script type="text/javascript" src="/includes/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/includes/ueditor/ueditor.all.js"></script>
<div class=" main-content">
    <div class="inner">
        <div class="lib-edit">
            <div class="header">
                <a href="/home/info/index.php?type=music"><i class="icons icons-back"></i> 音乐内容编辑</a>
            </div>
            <div class="content">
                <div class="preview">
                    <div class="cell">
                        <div class="lib-title" style="font-size:14px;border-bottom:1px dotted #cccccc;margin-bottom:10px;">
                            效果：
                        </div>
                        <div class="cover">
                       
                            <img src="/home/public/img/yinyueyl.jpg" style="width:246px;height:436px;"/>
                            
                        </div>
                    </div>
                </div><div class="editor">
                    <form id="text-form" method="post" action="/home/info/music.php">
					
					<div class="cell">
                        <div class="form-rule" role="form">
                            <div class="form-group">
                                <label>关键词<strong class="c-red">*</strong> <span class="c-gray">（PS:多个规则对应一条内容用逗号分隔。如：help ,帮助）</span></label>
                                <input name="keyword" type="text" class="form-control" value="<{$infoRow.keyword}>">
                            </div>
                        </div>
                    </div>
					
					<div class="cell cell-dark">
                        <div class="form-rule form-rule-add" role="form">
							<div class="form-group">
                                <label>类别<span class="c-gray"></span></label>
                                <select name="cate_id" class="form-control">
                                   
                                    <{foreach item="row" from=$cates}>
                                    <option value="<{$row.id}>"><{$row.cate_name}></option>
                                    <{/foreach}>
                                </select>
                            </div>
                            <div class="form-group">
                                <label>音乐名称<strong class="c-red">*</strong> </label>
                                <input name="music_name" type="text" class="form-control" value="<{$infoRow.music_name}>">
                            </div>
							<div class="form-group">
                                <label>简介</label>
                                <textarea id="goods_intro" name="music_desc" >
									<{$infoRow.music_desc}>
								</textarea>
                            </div>
							<div class="form-group">
                                <label>音乐链接地址<strong class="c-red">*</strong> <span class="c-gray">(mp3格式外链地址)</span></label>
                                <input name="music_url" type="text" class="form-control" value="<{$infoRow.music_url}>">
                            </div>
							<div class="form-group">
                                <label>状态<span class="c-gray"></span></label>
                                <br/>
                                <input type="radio" name="state" checked value='1'> 开放&nbsp;&nbsp;
                                <input type="radio" name="state"<{if $infoRow.state==2}>checked<{/if}>  value='2'> 关闭
                            </div>
                        </div>
                    </div>

                    <div class="opt">
                        <input type="hidden" name="id" value="<{$infoRow.id}>"/>
                        <input type="submit" class="btn btn-large btn-success" value="完成">
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    set_title_name('源资料库-音乐');
    set_menu_cur('menu_16','cur super');
    $(function(){
		var uea = UE.getEditor('goods_intro');
        $('#text-form').submit(function(){
            $.post($(this).attr('action'),$(this).serializeArray(),function(msg){
                try{
                    var obj = $.parseJSON(msg);
                    if(obj.success==1){ window.location.href='index.php?type=music';}else{
					
						//alert(obj.msg)
                        var evt = {clientX:$('input[type="submit"]').offset().left,clientY:$('input[type="submit"]').offset().top-380};
                    	note_info(obj.msg,'warn',evt);
                    }
                }catch(e){}
            });
            return false;
        });
		if("<{$infoRow.state}>"!='1' || "<{$infoRow.state}>"!='2'){
			
		}else{
			$('select[name=state]').val("<{$infoRow.state}>");
		}
		
		var SelectArr = $("select");
		for (var i = 0; i < SelectArr.length; i++) {
		  SelectArr[i].options[0].selected = true; 
		  }
    });
</script>